package com.hkd.blogsystem.mapper;

import com.hkd.blogsystem.model.UserInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserInfoMapper {
    /**
     * 根据名称查询用户信息
     * @return
     */
    @Select("select id,user_name,password,github_url from user where user_name = #{name} and delete_flag = 0")
    UserInfo selectByName(String name);
    @Select("select id,user_name,password,github_url from user where id = #{id} and delete_flag = 0")
    UserInfo selectById(Integer id);

    @Insert("insert into user (user_name, password) values (#{username}, #{password})")
    Integer registerUser(String username,String password);
}
